#!/home/kjirou/local/bin/ruby

begin
    require "cgi"
    cgi = CGI.new
    case cgi["api_name"]
    when "register"
        require "rb/register_api.rb"
        RegisterAPI.new
    when "check_registered"
        require "rb/check_registered_api.rb"
        CheckRegisteredAPI.new
    when "delete"
        require "rb/delete_api.rb"
        DeleteAPI.new
    when "get_tags"
        require "rb/get_tags_api.rb"
        GetTagsAPI.new
    when "get_bookmarks"
        require "rb/get_bookmarks_api.rb"
        GetBookmarksAPI.new
    else
        require "rb/api.rb"
        API.new
    end
rescue
    print $! , "\n", $@
end

